<template>
    <!-- 扫码支付的页面 -->

</template>

<script>
    export default {
        name: "saomapay",
        data(){
          return{
            payhtml: window.sessionStorage.getItem("payhtml")
          }
        },
        mounted(){
          const divForm = document.getElementsByTagName('div')
          if (divForm.length) {
            document.body.removeChild(divForm[0])
          }
          const div = document.createElement('div')
          // data就是接口返回的form 表单字符串
          div.innerHTML = this.payhtml
          document.body.appendChild(div)
          // 新开窗口跳转
          document.forms[0].setAttribute('target', '_blank')
          document.forms[0].submit()
        }
    }
</script>

<style scoped>

</style>
